from rest_framework.permissions import BasePermission
from wxchat.models import WxUserInfo
from wxchat.utils import get_openid_from_header


class FinancePermission(BasePermission):

    def has_permission(self, request, view):
        user = request.user
        print("FinancePermission:", user)
        if user is None:
            return False

        if user.is_superuser:
            return True
        else:
            return False

